Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 修复 Search placeholder 样式丢失的问题 #857

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

Moonofweisheng
Copy link
Owner

@Moonofweisheng Moonofweisheng commented Jan 20, 2025

Closes: #856

🤔 这个 PR 的性质是?(至少选择一个)

  • 日常 bug 修复
  • 新特性提交
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • CI/CD 改进
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 代码重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

#856

💡 需求背景和解决方案

修复Search placeholder 样式丢失的问题

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充

Summary by CodeRabbit

  • 样式调整
    • 优化搜索组件的占位符文本样式
    • 增强占位符类绑定的灵活性
    • 改进输入框占位符的动态样式处理

Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wot-design-uni ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 20, 2025 2:38am

Copy link

coderabbitai bot commented Jan 20, 2025

概述

演练

wd-search.vue 组件中,对占位符文本的处理和类绑定进行了修改。主要变更包括使用模板字面量动态绑定 placeholderClass,以增强组件的样式灵活性。这些修改旨在解决占位符样式丢失的问题,通过正确拼接和应用类名。

变更

文件 变更概要
src/uni_modules/wot-design-uni/components/wd-search/wd-search.vue 修改占位符类绑定,使用模板字面量正确拼接类名

对链接问题的评估

目标 是否解决 说明
修复 placeholder 样式丢失问题 [#856] -

可能相关的 PR

诗歌

兔子轻跳代码行,
样式修复显神清,
占位符闪耀光芒,
一行代码解千愁,
前端魔法绽光明!
🐰✨🔧


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c70a8a2 and b9d9aad.

📒 Files selected for processing (1)
  • src/uni_modules/wot-design-uni/components/wd-search/wd-search.vue (1 hunks)
🧰 Additional context used
📓 Learnings (1)
src/uni_modules/wot-design-uni/components/wd-search/wd-search.vue (1)
Learnt from: de1ck
PR: Moonofweisheng/wot-design-uni#845
File: src/uni_modules/wot-design-uni/components/wd-search/wd-search.vue:14-15
Timestamp: 2025-01-16T07:45:18.905Z
Learning: In uni-app's input component, the placeholder-class attribute only accepts string type in TypeScript, not array. Therefore, class names must be concatenated as strings rather than bound as arrays.
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Redirect rules - wot-design-uni
  • GitHub Check: Header rules - wot-design-uni
  • GitHub Check: Pages changed - wot-design-uni
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
src/uni_modules/wot-design-uni/components/wd-search/wd-search.vue (2)

8-8: 占位符文本类名绑定的修改看起来不错!

使用模板字符串来连接基础类名和动态类名的方式是正确的,这样可以确保样式正常应用。


14-14: 输入框占位符样式修复正确!

使用模板字符串连接类名的方式符合 uni-app 的要求,这个修改应该能解决 #856 中提到的样式丢失问题。

建议在以下场景进行测试验证:

  1. 默认状态下的占位符样式
  2. 自定义 placeholderClass 时的样式
  3. 深色/浅色主题下的样式表现

可以运行以下命令来检查相关的样式定义:

✅ Verification successful

占位符样式实现验证通过!

经过代码验证,确认:

  • 占位符样式类 wd-search__placeholder-txt 已正确定义
  • 模板字符串拼接类名的方式实现正确
  • 支持自定义样式类和深浅色主题
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 检查组件中的占位符相关样式定义
rg -A 2 "wd-search__placeholder" src/uni_modules/wot-design-uni/components/wd-search/

Length of output: 910


Script:

#!/bin/bash
# 检查组件样式定义
rg -A 2 "wd-search__placeholder" --type css --type scss --type vue src/uni_modules/wot-design-uni/components/wd-search/

Length of output: 148


Script:

#!/bin/bash
# 查看完整组件文件内容
cat src/uni_modules/wot-design-uni/components/wd-search/wd-search.vue

Length of output: 4927


Script:

#!/bin/bash
# 查看样式文件内容
cat src/uni_modules/wot-design-uni/components/wd-search/index.scss

Length of output: 3292


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Jan 20, 2025

Deploy Preview for wot-design-uni ready!

Name Link
🔨 Latest commit b9d9aad
🔍 Latest deploy log https://app.netlify.com/sites/wot-design-uni/deploys/678db720e4da2400084cc39d
😎 Deploy Preview https://deploy-preview-857--wot-design-uni.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

Deploying wot-design-uni with  Cloudflare Pages  Cloudflare Pages

Latest commit: b9d9aad
Status: ✅  Deploy successful!
Preview URL: https://94e44674.wot-design-uni.pages.dev
Branch Preview URL: https://fix-input-placeholder.wot-design-uni.pages.dev

View logs

@Moonofweisheng Moonofweisheng merged commit 40565d1 into master Jan 20, 2025
7 checks passed
@Moonofweisheng Moonofweisheng deleted the fix/input-placeholder branch January 20, 2025 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug 上报] wd-search的placeholder样式丢失
1 participant